<?php

namespace App\Http\Controllers\Vue;

use App\Http\Controllers\Controller;
use Jinxing\Admin\Repositories\Article\ArticleTypesRepository;

/**
 * Class ArticleTypesController 文章类型
 *
 * @package App\Http\Controllers\Vue
 */
class ArticleTypesController extends Controller
{
    /**
     * @var ArticleTypesRepository
     */
    private $articleTypesRepository;

    public function __construct(ArticleTypesRepository $articleTypesRepository)
    {
        $this->articleTypesRepository = $articleTypesRepository;
    }

    public function index()
    {
        return $this->success($this->articleTypesRepository->findAll([
            'status' => 1,
            'order'  => 'sort asc,type_id asc',
        ], ['type_id', 'name', 'description']));
    }
}
